package com.qzsoft.system.modules.syslogerror.controller;

import java.util.Map;

import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qzsoft.jeemis.common.utils.Result;
import com.qzsoft.system.modules.syslogerror.entity.ZhjdSysLogErrorEntity;
import com.qzsoft.system.modules.syslogerror.service.ZhjdSysLogErrorService;
import com.qzsoft.zhjd.common.utils.ResultUtils;

/**
 * @ClassName ZhjdSysLogErrorController
 * @Description 错误日志控制器
 * @author linhuawei
 * @since 2022-05-16
 */
@RestController
@RequestMapping("/api/sysLogError")
public class ZhjdSysLogErrorController {

    @Autowired
    private ZhjdSysLogErrorService zhjdSysLogErrorService;

    /**
     * @Title page
     * @Description 获取错误日志分页数据
     * @param params 查询条件
     * @return 分页数据
     */
    @GetMapping("/page")
    public Result<IPage<ZhjdSysLogErrorEntity>> page(@RequestParam Map<String, Object> params) {
        IPage<ZhjdSysLogErrorEntity> page = zhjdSysLogErrorService.page(params);
        return ResultUtils.ok(page);
    }

    /**
     * @Title export
     * @Description 导出excel文件
     * @param params
     */
    @GetMapping("/export")
    public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) {
        zhjdSysLogErrorService.export(params, response);
    }
    
}
